<!--
 * @Descripttion: 
 * @version: 
 * @Author: wtzhang
 * @Date: 2021-07-28 14:53:42
 * @LastEditors: wtzhang
 * @LastEditTime: 2021-07-29 10:49:28
-->
<template>
    <div>
      <addition></addition>
      <hr>
      <subtract></subtract>
      <hr>
      getters:
      <h3>第一种调用getter：<br>{{$store.getters.showNum}}</h3>
      <h3>第二种调用getter：<br>{{showNum}}</h3>
    </div>
</template>

<script>
import addition from './components/add.vue'
import subtract from './components/subtract.vue'
import { mapActions, mapGetters } from 'vuex'
export default {
  data(){
    return {}
  },
  components: {
    addition,
    subtract
  },
  computed: {
    ...mapGetters(['showNum'])
  }
}
</script>

<style lang="scss" scoped>
    
</style>
